package com.lwj.liwanjia.adapter;

import android.content.Context;
import android.graphics.Paint;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.lwj.liwanjia.R;
import com.lwj.liwanjia.bean.BaobeiBean;
import com.lwj.liwanjia.bean.DpBean;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;

import java.util.List;

/**
 * 模糊搜索结果
 */

public class SearchListAdapter1 extends SuperBaseAdapter<DpBean.DataBean> {
    private Context context;

    public SearchListAdapter1(Context context, List<DpBean.DataBean> data) {
        super(context, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, DpBean.DataBean item, int position) {
        Glide.with(context).load(item.getShopImage()).error(R.mipmap.zhanweitu_1).into((ImageView) holder.getView(R.id.iv_dianpu));
        holder.setText(R.id.tv_dianpu_name, item.getShopName())
                .setText(R.id.tv_xiaoliang, "销量" + item.getSales_volume())
                .setText(R.id.tv_sum, "共" + item.getGoodsNum() + "件宝贝");
    }

    @Override
    protected int getItemViewLayoutId(int position, DpBean.DataBean item) {
        return R.layout.search_detail_item1;//店铺
    }

}
